package com.stjb.furns.dao.impl;

import com.stjb.furns.dao.BasicDAO;
import com.stjb.furns.dao.OrderItemDAO;
import com.stjb.furns.entity.OrderItem;

/**
 * @author situ
 * @version 1.0
 * @date 2025/5/29 21:02
 * @Description:
 */
public class OrderItemDAOImpl extends BasicDAO<OrderItem> implements OrderItemDAO {

    @Override
    public int saveOrderItem(OrderItem orderItem) {
        String sql = "insert into `order_item` (`id`,`name`,`price`,`count`,`total_price`,`order_id`)\n" +
                "value (?,?,?,?,?,?)";
        return update(sql, orderItem.getId(), orderItem.getName(), orderItem.getPrice(),
                orderItem.getCount(), orderItem.getTotalPrice(), orderItem.getOrderId());
    }
}
